from .base_page import BasePage
from selenium.webdriver.common.by import By

class AssetInfoPage(BasePage):
    def __init__(self, webdriver):
        super().__init__(webdriver)

    def find_cpu(self, id_='asset_cpu'):
        return self.find_element('id', id_)

    def find_memory(self, id_='asset_mem'):
        return self.find_element('id', id_)
    
    def find_disk(self, id_='asset_hdd'):
        return self.find_element('id', id_)
        
    def find_psu(self, id_='asset_psu'):
        return self.find_element('id', id_)
    
    def click(self, element):
        self.click_element(element)

    """获取子元素"""
    def find_all_elements(self, element, by=By.XPATH, str="./*"):
        return element.find_elements(by, str)
    